import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
      meta: {
        iskeepalive: true
      }
    },
    {
      path: '/category',
      name: 'category',
      component: () => import('../views/CategoryView.vue'),
      meta: {
        iskeepalive: true
      }
    },
    {
      path: '/car',
      name: 'car',
      component: () => import('../views/CarView.vue'),
      meta: {
        iskeepalive: false
      }
    },
    {
      path: '/mine',
      name: 'mine',
      component: () => import('../views/MineView.vue'),
      meta: {
        iskeepalive: false
      }
    },
    {
      path: '/transition',
      name: 'transition',
      component: () => import('../views/TransitionView.vue'),
      meta: {
        iskeepalive: false
      }
    },
    {
      path: '/sass',
      name: 'sass',
      component: () => import('../views/SassView.vue'),
      meta: {
        iskeepalive: false
      }
    }
  ]
})

export default router
